#ifndef VIDEOWINDOW_H
#define VIDEOWINDOW_H

#include <QMainWindow>
#include <QListWidgetItem>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include <QVideoWidget>
#include "exitfullscreenevent.h"
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QSqlDatabase>

namespace Ui {
class VideoWindow;
}

class VideoWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit VideoWindow(QWidget *parent = nullptr);
    ~VideoWindow();
    void updateBtnMode();
    void LocalVideoDatabase();

private slots:
    void on_btn_play_clicked();

    void on_btn_load_clicked();

    void on_localList_itemDoubleClicked(QListWidgetItem *item);

    void on_btn_next_clicked();

    void on_btn_pre_clicked();

    void setTotal(qint64 duration);

    void setPosition(qint64 position);

    void on_pushButton_clicked();

    void on_progress_bar_sliderReleased();

    void on_btn_fullscreen_clicked();

    void ExitFullScreen();

    void onlineVideoShow(QNetworkReply *reply);

    void on_onlineList_itemDoubleClicked(QListWidgetItem *item);

private:
    Ui::VideoWindow *ui;
    QMediaPlayer *player;
    QMediaPlaylist *playlist;
    QMediaPlayer *onlineplayer;
    QMediaPlaylist *onlineplaylist;
    QVideoWidget *videoWidget;
    int total=0;
    ExitFullScreenEvent *exitevent;
};

#endif // VIDEOWINDOW_H
